package com.nd.controller.wx;

import com.nd.pojo.bean.Brand;
import com.nd.pojo.bo.wx.BrandListWXBo;
import com.nd.pojo.vo.wx.BaseRespWXVo;
import com.nd.pojo.vo.wx.BrandDetailVo;
import com.nd.pojo.vo.wx.BrandListWXVo;
import com.nd.service.wx.BrandWXService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @Author : PengFei Zhang
 * @Data :2021/6/8  15:48
 * @Description :
 */
//品牌  zpf

@RestController
@RequestMapping("wx")
public class BrandController {
    @Autowired
    BrandWXService brandWXService;

    //品牌列表
    @RequestMapping("brand/list")
    public BaseRespWXVo brandList(BrandListWXBo brandListWXBo){
         BrandListWXVo brandWXLisetVo=brandWXService.selectBrandToList(brandListWXBo);
         return BaseRespWXVo.ok(brandWXLisetVo);
    }
    //品牌详情
    @RequestMapping("brand/detail")
    public BaseRespWXVo brandDetail(Integer id){
        BrandDetailVo brandDetailVo= brandWXService.selectBrandDetail(id);
        HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
        objectObjectHashMap.put("brand",brandDetailVo);
        return BaseRespWXVo.ok( objectObjectHashMap);
    }
}
